<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>函数的变化</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="migration56.deprecated.html">« PHP 5.6.x 中已废止的特性</a></li>
      <li style="float: right;"><a href="migration56.new-functions.html">新加函数 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="migration56.html">从 PHP 5.5.x 移植到 PHP 5.6.x</a></li>
    <li>函数的变化</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="migration56.changed-functions" class="sect1">
 <h2 class="title">函数的变化</h2>

 <div class="sect2" id="migration56.changed-functions.core">
  <h3 class="title">PHP 内核</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     如果省略 <code class="parameter">salt</code> 参数，<span class="function"><a href="function.crypt.html" class="function">crypt()</a></span> 会产生
     <strong><code>E_NOTICE</code></strong>错误。
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <span class="function"><a href="function.substr-compare.html" class="function">substr_compare()</a></span> 的 <code class="parameter">length</code> 参数现在接受 <code class="literal">0</code> 的值。
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <span class="function"><a href="function.unserialize.html" class="function">unserialize()</a></span> will now fail if passed serialised data
     that has been manipulated to attempt to instantiate an object without
     calling its constructor.
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.curl">
  <h3 class="title"><a href="book.curl.html" class="link">cURL</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     只有设置  <strong><code>CURLOPT_SAFE_UPLOAD</code></strong>  为 <strong><code>false</code></strong> 的情况下，
     才接受 <code class="literal">@file</code> 语法上传文件。
     最好使用 <span class="classname"><a href="class.curlfile.html" class="classname">CURLFile</a></span> 代替。
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.mcrypt">
  <h3 class="title"><a href="book.mcrypt.html" class="link">Mcrypt</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <span class="function"><a href="function.mcrypt-create-iv.html" class="function">mcrypt_create_iv()</a></span> 的 <code class="parameter">source</code>
     现在默认值是
     <strong><code>MCRYPT_DEV_URANDOM</code></strong>，而非
     <strong><code>MCRYPT_DEV_RANDOM</code></strong>。
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.openssl">
  <h3 class="title"><a href="book.openssl.html" class="link">OpenSSL</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     如果 SSL 上下文选项已经提供 <code class="parameter">crypto_type</code> 选项，
     <span class="function"><a href="function.stream-socket-enable-crypto.html" class="function">stream_socket_enable_crypto()</a></span> 可以忽略 <code class="parameter">crypto_type</code> 参数。
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.pgsql">
  <h3 class="title"><a href="book.pgsql.html" class="link">PostgreSQL</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <span class="function"><a href="function.pg-insert.html" class="function">pg_insert()</a></span>、<span class="function"><a href="function.pg-select.html" class="function">pg_select()</a></span>、
     <span class="function"><a href="function.pg-update.html" class="function">pg_update()</a></span>、<span class="function"><a href="function.pg-delete.html" class="function">pg_delete()</a></span> 不再是实验性质的。
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     如果数据库连接 socket 流设置为非阻塞（non-blocking）模式，
     <span class="function"><a href="function.pg-send-execute.html" class="function">pg_send_execute()</a></span>、
     <span class="function"><a href="function.pg-send-prepare.html" class="function">pg_send_prepare()</a></span>、<span class="function"><a href="function.pg-send-query.html" class="function">pg_send_query()</a></span>
     、<span class="function"><a href="function.pg-send-query-params.html" class="function">pg_send_query_params()</a></span> 不再会阻塞查询直到写入完成。
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.reflection">
  <h3 class="title"><a href="book.reflection.html" class="link">Reflection</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <span class="methodname"><a href="reflectionclass.newinstancewithoutconstructor.html" class="methodname">ReflectionClass::newInstanceWithoutConstructor()</a></span>
    现在允许非 Final 的内部类实例化。
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration56.changed-functions.xmlreader">
  <h3 class="title"><a href="book.xmlreader.html" class="link">XMLReader</a></h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     和 <span class="methodname"><a href="xmlreader.getattribute.html" class="methodname">XMLReader::getAttribute()</a></span> 一样，未找到属性的情况下，
     <span class="methodname"><a href="xmlreader.getattributens.html" class="methodname">XMLReader::getAttributeNs()</a></span> 和
     <span class="methodname"><a href="xmlreader.getattributeno.html" class="methodname">XMLReader::getAttributeNo()</a></span> 会返回 <strong><code>null</code></strong> 。
    </span>
   </li>
  </ul>
 </div>
</div></div></div></body></html>